﻿<?xml version="1.0" encoding="utf-8" ?>

<cls:class
	name="PixelRenderer"
	type="http://metalx.org/Video/Graphics/PixelRenderer"
	xmlns="http://metalx.org/Program"
	xmlns:cls="http://metalx.org/Class"
	xmlns:var="http://metalx.org/Variable"
	xmlns:clsf="http://metalx.org/i386/Functions/Class"
	xmlns:sys="http://metalx.org/i386/Functions/System"
	xmlns:cat="http://metalx.org/i386/Functions/Catalog"
	xmlns:obj="http://metalx.org/i386/Functions/Object"
	xmlns:mm="http://metalx.org/i386/Functions/MemoryManager"
	xmlns:bool="http://metalx.org/i386/Functions/Boolean"
	xmlns:str="http://metalx.org/i386/Functions/String"
	xmlns:int="http://metalx.org/i386/Functions/Integer"
	xmlns:hex="http://metalx.org/i386/Functions/Hexadecimal"
	xmlns:math="http://metalx.org/Intel/80386/Math"
	xmlns:ari="http://metalx.org/Intel/80386/Arithmetic"
	xmlns:shift="http://metalx.org/Intel/80386/Shift"
	xmlns:logic="http://metalx.org/Intel/80386/Logic"
	xmlns:imm="http://metalx.org/Intel/80386/Immediate"
	xmlns:index="http://metalx.org/Intel/80386/Index"
	xmlns:cpu="http://metalx.org/Intel/80386/Operators"
	xmlns:op="http://metalx.org/Intel/80386/Operands">

	<cls:method name="SetColor" type="http://metalx.org/Video/Graphics/PixelRenderer">
		<cls:parameter name="Color" type="http://metalx.org/Video/Graphics/Color"/>

		<cpu:MathImmediate8ToOperandFunction/>
		<math:AddToBPRegister/>
		<byte>4</byte>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="DrawPoint" type="http://metalx.org/Video/Graphics/PixelRenderer">
		<cls:parameter name="Point" type="http://metalx.org/Video/Graphics/Point"/>
		<cls:parameter name="Color" type="http://metalx.org/Video/Graphics/Color"/>

		<cpu:MathImmediate8ToOperandFunction/>
		<math:AddToBPRegister/>
		<byte>8</byte>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="DrawHorizontalLine" type="http://metalx.org/Video/Graphics/PixelRenderer">
		<cls:parameter name="Line" type="http://metalx.org/Video/Graphics/Line"/>
		<cls:parameter name="Color" type="http://metalx.org/Video/Graphics/Color"/>

		<cpu:MathImmediate8ToOperandFunction/>
		<math:AddToBPRegister/>
		<byte>8</byte>

		<cls:return/>
	</cls:method>

	<cls:method name="DrawVerticalLine" type="http://metalx.org/Video/Graphics/PixelRenderer">
		<cls:parameter name="Line" type="http://metalx.org/Video/Graphics/Line"/>
		<cls:parameter name="Color" type="http://metalx.org/Video/Graphics/Color"/>

		<cpu:MathImmediate8ToOperandFunction/>
		<math:AddToBPRegister/>
		<byte>16</byte>

		<cls:return/>
	</cls:method>

	<cls:method name="FillRectangle" type="http://metalx.org/Video/Graphics/PixelRenderer">
		<cls:parameter name="Rectangle" type="http://metalx.org/Video/Graphics/Rectangle"/>
		<cls:parameter name="Color" type="http://metalx.org/Video/Graphics/Color"/>

		<cpu:MathImmediate8ToOperandFunction/>
		<math:AddToBPRegister/>
		<byte>8</byte>

		<cls:return/>
	</cls:method>

	<cls:method name="DrawImage" type="http://metalx.org/Video/Graphics/PixelRenderer">
		<cls:parameter name="Image" type="http://metalx.org/Video/Graphics/Image"/>
		<cls:parameter name="Point" type="http://metalx.org/Video/Graphics/Point"/>

		<cpu:MathImmediate8ToOperandFunction/>
		<math:AddToBPRegister/>
		<byte>8</byte>

		<cls:return/>
	</cls:method>

	<cls:method name="GetSize" type="http://metalx.org/Video/Graphics/Size">
		<cpu:ExclusiveOrRegisterWithOperand/>
		<op:DI-DIRegister/>

		<cls:return/>
	</cls:method>

	<cls:method name="ToString" type="http://metalx.org/String">
		<cpu:CopyImmediateToDI/>
		<addressOf ref="className" type="Absolute32"/>

		<str:CreateObject/>

		<cpu:ReturnToNearCaller/>

		<var:string id="className">Mesh Renderer</var:string>
	</cls:method>

	<cls:method name="GetClass" type="http://metalx.org/Class">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetType/>

		<cpu:CopyRegisterToOperand/>
		<op:SI-DIRegister/>

		<clsf:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="GetClass" type="http://metalx.org/Class" static="true">
		<cpu:CopyRegisterToOperand/>
		<op:BX-DIRegister/>

		<clsf:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>
</cls:class>